<?php
/* @var $this UserController */
/* @var $model User */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-detail-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// See class documentation of CActiveForm for details on this,
	// you need to use the performAjaxValidation()-method described there.
	'enableAjaxValidation'=>true,
	'clientOptions'=>array('validateOnSubmit'=>true),
)); ?>
	<h3>User</h3>
	<p class="note">Fields with <span class="required">*</span> are required.</p>
	<table>
    	<tr>
        	<td class="td-text-align"><?php echo $form->labelEx($model,'active'); ?></td>
            <td><?php echo $form->checkBox($model,'active'); ?></td>
            <td class="td-text-align"><?php echo $form->labelEx($model,'isadmin'); ?></td>
            <td><?php echo $form->checkBox($model,'isadmin'); ?></td>
        </tr>
        <tr>
        	<td class="td-text-align"><?php echo $form->labelEx($model,'username'); ?></td>
            <td><?php echo $form->textField($model,'username'); ?></td>
            <td class="td-text-align"><?php echo $form->labelEx($model,'password2'); ?></td>
            <td><?php echo $form->passwordField($model,'password2'); ?></td>
        </tr>
        <tr>
        	<td class="td-text-align"><?php echo $form->labelEx($model,'displayname'); ?></td>
            <td><?php echo $form->textField($model,'displayname'); ?></td>
            <td class="td-text-align"><?php echo $form->labelEx($model,'email'); ?></td>
            <td><?php echo $form->textField($model,'email'); ?></td>
        </tr>
        <tr>
        	<td class="td-text-align"><?php echo $form->labelEx($model,'position'); ?></td>
            <td><?php echo $form->textField($model,'position'); ?></td>
            <td class="td-text-align"><?php echo $form->labelEx($model,'mobile'); ?></td>
            <td><?php echo $form->textField($model,'mobile'); ?></td>
        </tr>
        <tr>
        	<td>&nbsp;</td>
            <td align="center" colspan="3">
				<?php echo '<ul style="color:red">' . $error . '</ul>';?>
                <?php echo '<ul style="color:blue">' . $msg . '</ul>';?>            
            </td>
        </tr>
        <tr>
            <td align="center" colspan="4">
            	<div class="row buttons" align="center">
					<?php echo CHtml::submitButton(' Save '); ?>
                    <?php echo CHtml::button(' Cancel ', array('onclick'=>'js:document.location.href="'.Yii::app()->createUrl('admin/user/list').'"')); ?>
                </div>
            </td>
        </tr>
    </table>
<?php $this->endWidget(); ?>

</div><!-- form -->